import socket

socket_servet = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_servet.bind(("127.0.0.1", 8888))
socket_servet.listen(5)
print("服务器启动完成，等待客户端的链接---------")
client, address = socket_servet.accept()
print("连接完成")

while True:
    data = client.recv(1024).decode("utf-8")
    if data == "close":
        print("服务器关闭")
        socket_servet.close()
        break
    print("服务器接收到的数据：", data)
    print("请输入回回复客户端的数据：")
    client.send(input().encode("utf-8"))



